Termination w.r.t. Q of the following Term Rewriting System could be proven:

Q restricted rewrite system:
The TRS R consists of the following rules:

app(perfectp, 0) → false
app(perfectp, app(s, x)) → app(app(app(app(f, x), app(s, 0)), app(s, x)), app(s, x))
app(app(app(app(f, 0), y), 0), u) → true
app(app(app(app(f, 0), y), app(s, z)), u) → false
app(app(app(app(f, app(s, x)), 0), z), u) → app(app(app(app(f, x), u), app(app(minus, z), app(s, x))), u)
app(app(app(app(f, app(s, x)), app(s, y)), z), u) → app(app(app(if, app(app(le, x), y)), app(app(app(app(f, app(s, x)), app(app(minus, y), x)), z), u)), app(app(app(app(f, x), u), z), u))
app(app(map, fun), nil) → nil
app(app(map, fun), app(app(cons, x), xs)) → app(app(cons, app(fun, x)), app(app(map, fun), xs))
app(app(filter, fun), nil) → nil
app(app(filter, fun), app(app(cons, x), xs)) → app(app(app(app(filter2, app(fun, x)), fun), x), xs)
app(app(app(app(filter2, true), fun), x), xs) → app(app(cons, x), app(app(filter, fun), xs))
app(app(app(app(filter2, false), fun), x), xs) → app(app(filter, fun), xs)

Q is empty.


QTRS
  ↳ Overlay + Local Confluence

Q restricted rewrite system:
The TRS R consists of the following rules:

app(perfectp, 0) → false
app(perfectp, app(s, x)) → app(app(app(app(f, x), app(s, 0)), app(s, x)), app(s, x))
app(app(app(app(f, 0), y), 0), u) → true
app(app(app(app(f, 0), y), app(s, z)), u) → false
app(app(app(app(f, app(s, x)), 0), z), u) → app(app(app(app(f, x), u), app(app(minus, z), app(s, x))), u)
app(app(app(app(f, app(s, x)), app(s, y)), z), u) → app(app(app(if, app(app(le, x), y)), app(app(app(app(f, app(s, x)), app(app(minus, y), x)), z), u)), app(app(app(app(f, x), u), z), u))
app(app(map, fun), nil) → nil
app(app(map, fun), app(app(cons, x), xs)) → app(app(cons, app(fun, x)), app(app(map, fun), xs))
app(app(filter, fun), nil) → nil
app(app(filter, fun), app(app(cons, x), xs)) → app(app(app(app(filter2, app(fun, x)), fun), x), xs)
app(app(app(app(filter2, true), fun), x), xs) → app(app(cons, x), app(app(filter, fun), xs))
app(app(app(app(filter2, false), fun), x), xs) → app(app(filter, fun), xs)

Q is empty.

The TRS is overlay and locally confluent. By [15] we can switch to innermost.

↳ QTRS
  ↳ Overlay + Local Confluence
QTRS
      ↳ DependencyPairsProof

Q restricted rewrite system:
The TRS R consists of the following rules:

app(perfectp, 0) → false
app(perfectp, app(s, x)) → app(app(app(app(f, x), app(s, 0)), app(s, x)), app(s, x))
app(app(app(app(f, 0), y), 0), u) → true
app(app(app(app(f, 0), y), app(s, z)), u) → false
app(app(app(app(f, app(s, x)), 0), z), u) → app(app(app(app(f, x), u), app(app(minus, z), app(s, x))), u)
app(app(app(app(f, app(s, x)), app(s, y)), z), u) → app(app(app(if, app(app(le, x), y)), app(app(app(app(f, app(s, x)), app(app(minus, y), x)), z), u)), app(app(app(app(f, x), u), z), u))
app(app(map, fun), nil) → nil
app(app(map, fun), app(app(cons, x), xs)) → app(app(cons, app(fun, x)), app(app(map, fun), xs))
app(app(filter, fun), nil) → nil
app(app(filter, fun), app(app(cons, x), xs)) → app(app(app(app(filter2, app(fun, x)), fun), x), xs)
app(app(app(app(filter2, true), fun), x), xs) → app(app(cons, x), app(app(filter, fun), xs))
app(app(app(app(filter2, false), fun), x), xs) → app(app(filter, fun), xs)

The set Q consists of the following terms:

app(perfectp, 0)
app(perfectp, app(s, x0))
app(app(app(app(f, 0), x0), 0), x1)
app(app(app(app(f, 0), x0), app(s, x1)), x2)
app(app(app(app(f, app(s, x0)), 0), x1), x2)
app(app(app(app(f, app(s, x0)), app(s, x1)), x2), x3)
app(app(map, x0), nil)
app(app(map, x0), app(app(cons, x1), x2))
app(app(filter, x0), nil)
app(app(filter, x0), app(app(cons, x1), x2))
app(app(app(app(filter2, true), x0), x1), x2)
app(app(app(app(filter2, false), x0), x1), x2)


Using Dependency Pairs [1,13] we result in the following initial DP problem:
Q DP problem:
The TRS P consists of the following rules:

APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(f, app(s, x)), app(app(minus, y), x))
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(minus, y), x)
APP(perfectp, app(s, x)) → APP(app(app(f, x), app(s, 0)), app(s, x))
APP(app(map, fun), app(app(cons, x), xs)) → APP(app(cons, app(fun, x)), app(app(map, fun), xs))
APP(perfectp, app(s, x)) → APP(f, x)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(f, x), u)
APP(app(filter, fun), app(app(cons, x), xs)) → APP(app(app(filter2, app(fun, x)), fun), x)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(le, x)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(app(app(f, app(s, x)), app(app(minus, y), x)), z), u)
APP(app(filter, fun), app(app(cons, x), xs)) → APP(app(app(app(filter2, app(fun, x)), fun), x), xs)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(if, app(app(le, x), y))
APP(app(app(app(f, app(s, x)), 0), z), u) → APP(minus, z)
APP(app(app(app(filter2, true), fun), x), xs) → APP(app(cons, x), app(app(filter, fun), xs))
APP(perfectp, app(s, x)) → APP(app(f, x), app(s, 0))
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(minus, y)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(app(f, x), u), z)
APP(app(filter, fun), app(app(cons, x), xs)) → APP(filter2, app(fun, x))
APP(app(map, fun), app(app(cons, x), xs)) → APP(fun, x)
APP(app(app(app(filter2, true), fun), x), xs) → APP(app(filter, fun), xs)
APP(app(app(app(f, app(s, x)), 0), z), u) → APP(app(f, x), u)
APP(app(filter, fun), app(app(cons, x), xs)) → APP(app(filter2, app(fun, x)), fun)
APP(app(app(app(filter2, false), fun), x), xs) → APP(filter, fun)
APP(perfectp, app(s, x)) → APP(app(app(app(f, x), app(s, 0)), app(s, x)), app(s, x))
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(app(f, app(s, x)), app(app(minus, y), x)), z)
APP(app(filter, fun), app(app(cons, x), xs)) → APP(fun, x)
APP(app(map, fun), app(app(cons, x), xs)) → APP(app(map, fun), xs)
APP(app(app(app(f, app(s, x)), 0), z), u) → APP(f, x)
APP(perfectp, app(s, x)) → APP(s, 0)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(app(app(f, x), u), z), u)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(le, x), y)
APP(app(app(app(f, app(s, x)), 0), z), u) → APP(app(app(f, x), u), app(app(minus, z), app(s, x)))
APP(app(app(app(filter2, true), fun), x), xs) → APP(filter, fun)
APP(app(app(app(f, app(s, x)), 0), z), u) → APP(app(minus, z), app(s, x))
APP(app(app(app(f, app(s, x)), 0), z), u) → APP(app(app(app(f, x), u), app(app(minus, z), app(s, x))), u)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(if, app(app(le, x), y)), app(app(app(app(f, app(s, x)), app(app(minus, y), x)), z), u))
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(app(if, app(app(le, x), y)), app(app(app(app(f, app(s, x)), app(app(minus, y), x)), z), u)), app(app(app(app(f, x), u), z), u))
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(f, x)
APP(app(app(app(filter2, true), fun), x), xs) → APP(cons, x)
APP(app(app(app(filter2, false), fun), x), xs) → APP(app(filter, fun), xs)
APP(app(map, fun), app(app(cons, x), xs)) → APP(cons, app(fun, x))

The TRS R consists of the following rules:

app(perfectp, 0) → false
app(perfectp, app(s, x)) → app(app(app(app(f, x), app(s, 0)), app(s, x)), app(s, x))
app(app(app(app(f, 0), y), 0), u) → true
app(app(app(app(f, 0), y), app(s, z)), u) → false
app(app(app(app(f, app(s, x)), 0), z), u) → app(app(app(app(f, x), u), app(app(minus, z), app(s, x))), u)
app(app(app(app(f, app(s, x)), app(s, y)), z), u) → app(app(app(if, app(app(le, x), y)), app(app(app(app(f, app(s, x)), app(app(minus, y), x)), z), u)), app(app(app(app(f, x), u), z), u))
app(app(map, fun), nil) → nil
app(app(map, fun), app(app(cons, x), xs)) → app(app(cons, app(fun, x)), app(app(map, fun), xs))
app(app(filter, fun), nil) → nil
app(app(filter, fun), app(app(cons, x), xs)) → app(app(app(app(filter2, app(fun, x)), fun), x), xs)
app(app(app(app(filter2, true), fun), x), xs) → app(app(cons, x), app(app(filter, fun), xs))
app(app(app(app(filter2, false), fun), x), xs) → app(app(filter, fun), xs)

The set Q consists of the following terms:

app(perfectp, 0)
app(perfectp, app(s, x0))
app(app(app(app(f, 0), x0), 0), x1)
app(app(app(app(f, 0), x0), app(s, x1)), x2)
app(app(app(app(f, app(s, x0)), 0), x1), x2)
app(app(app(app(f, app(s, x0)), app(s, x1)), x2), x3)
app(app(map, x0), nil)
app(app(map, x0), app(app(cons, x1), x2))
app(app(filter, x0), nil)
app(app(filter, x0), app(app(cons, x1), x2))
app(app(app(app(filter2, true), x0), x1), x2)
app(app(app(app(filter2, false), x0), x1), x2)

We have to consider all minimal (P,Q,R)-chains.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
QDP
          ↳ EdgeDeletionProof

Q DP problem:
The TRS P consists of the following rules:

APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(f, app(s, x)), app(app(minus, y), x))
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(minus, y), x)
APP(perfectp, app(s, x)) → APP(app(app(f, x), app(s, 0)), app(s, x))
APP(app(map, fun), app(app(cons, x), xs)) → APP(app(cons, app(fun, x)), app(app(map, fun), xs))
APP(perfectp, app(s, x)) → APP(f, x)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(f, x), u)
APP(app(filter, fun), app(app(cons, x), xs)) → APP(app(app(filter2, app(fun, x)), fun), x)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(le, x)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(app(app(f, app(s, x)), app(app(minus, y), x)), z), u)
APP(app(filter, fun), app(app(cons, x), xs)) → APP(app(app(app(filter2, app(fun, x)), fun), x), xs)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(if, app(app(le, x), y))
APP(app(app(app(f, app(s, x)), 0), z), u) → APP(minus, z)
APP(app(app(app(filter2, true), fun), x), xs) → APP(app(cons, x), app(app(filter, fun), xs))
APP(perfectp, app(s, x)) → APP(app(f, x), app(s, 0))
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(minus, y)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(app(f, x), u), z)
APP(app(filter, fun), app(app(cons, x), xs)) → APP(filter2, app(fun, x))
APP(app(map, fun), app(app(cons, x), xs)) → APP(fun, x)
APP(app(app(app(filter2, true), fun), x), xs) → APP(app(filter, fun), xs)
APP(app(app(app(f, app(s, x)), 0), z), u) → APP(app(f, x), u)
APP(app(filter, fun), app(app(cons, x), xs)) → APP(app(filter2, app(fun, x)), fun)
APP(app(app(app(filter2, false), fun), x), xs) → APP(filter, fun)
APP(perfectp, app(s, x)) → APP(app(app(app(f, x), app(s, 0)), app(s, x)), app(s, x))
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(app(f, app(s, x)), app(app(minus, y), x)), z)
APP(app(filter, fun), app(app(cons, x), xs)) → APP(fun, x)
APP(app(map, fun), app(app(cons, x), xs)) → APP(app(map, fun), xs)
APP(app(app(app(f, app(s, x)), 0), z), u) → APP(f, x)
APP(perfectp, app(s, x)) → APP(s, 0)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(app(app(f, x), u), z), u)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(le, x), y)
APP(app(app(app(f, app(s, x)), 0), z), u) → APP(app(app(f, x), u), app(app(minus, z), app(s, x)))
APP(app(app(app(filter2, true), fun), x), xs) → APP(filter, fun)
APP(app(app(app(f, app(s, x)), 0), z), u) → APP(app(minus, z), app(s, x))
APP(app(app(app(f, app(s, x)), 0), z), u) → APP(app(app(app(f, x), u), app(app(minus, z), app(s, x))), u)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(if, app(app(le, x), y)), app(app(app(app(f, app(s, x)), app(app(minus, y), x)), z), u))
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(app(if, app(app(le, x), y)), app(app(app(app(f, app(s, x)), app(app(minus, y), x)), z), u)), app(app(app(app(f, x), u), z), u))
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(f, x)
APP(app(app(app(filter2, true), fun), x), xs) → APP(cons, x)
APP(app(app(app(filter2, false), fun), x), xs) → APP(app(filter, fun), xs)
APP(app(map, fun), app(app(cons, x), xs)) → APP(cons, app(fun, x))

The TRS R consists of the following rules:

app(perfectp, 0) → false
app(perfectp, app(s, x)) → app(app(app(app(f, x), app(s, 0)), app(s, x)), app(s, x))
app(app(app(app(f, 0), y), 0), u) → true
app(app(app(app(f, 0), y), app(s, z)), u) → false
app(app(app(app(f, app(s, x)), 0), z), u) → app(app(app(app(f, x), u), app(app(minus, z), app(s, x))), u)
app(app(app(app(f, app(s, x)), app(s, y)), z), u) → app(app(app(if, app(app(le, x), y)), app(app(app(app(f, app(s, x)), app(app(minus, y), x)), z), u)), app(app(app(app(f, x), u), z), u))
app(app(map, fun), nil) → nil
app(app(map, fun), app(app(cons, x), xs)) → app(app(cons, app(fun, x)), app(app(map, fun), xs))
app(app(filter, fun), nil) → nil
app(app(filter, fun), app(app(cons, x), xs)) → app(app(app(app(filter2, app(fun, x)), fun), x), xs)
app(app(app(app(filter2, true), fun), x), xs) → app(app(cons, x), app(app(filter, fun), xs))
app(app(app(app(filter2, false), fun), x), xs) → app(app(filter, fun), xs)

The set Q consists of the following terms:

app(perfectp, 0)
app(perfectp, app(s, x0))
app(app(app(app(f, 0), x0), 0), x1)
app(app(app(app(f, 0), x0), app(s, x1)), x2)
app(app(app(app(f, app(s, x0)), 0), x1), x2)
app(app(app(app(f, app(s, x0)), app(s, x1)), x2), x3)
app(app(map, x0), nil)
app(app(map, x0), app(app(cons, x1), x2))
app(app(filter, x0), nil)
app(app(filter, x0), app(app(cons, x1), x2))
app(app(app(app(filter2, true), x0), x1), x2)
app(app(app(app(filter2, false), x0), x1), x2)

We have to consider all minimal (P,Q,R)-chains.
We deleted some edges using various graph approximations

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ EdgeDeletionProof
QDP
              ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(minus, y), x)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(f, app(s, x)), app(app(minus, y), x))
APP(perfectp, app(s, x)) → APP(app(app(f, x), app(s, 0)), app(s, x))
APP(app(map, fun), app(app(cons, x), xs)) → APP(app(cons, app(fun, x)), app(app(map, fun), xs))
APP(perfectp, app(s, x)) → APP(f, x)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(f, x), u)
APP(app(filter, fun), app(app(cons, x), xs)) → APP(app(app(filter2, app(fun, x)), fun), x)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(app(app(f, app(s, x)), app(app(minus, y), x)), z), u)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(le, x)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(if, app(app(le, x), y))
APP(app(filter, fun), app(app(cons, x), xs)) → APP(app(app(app(filter2, app(fun, x)), fun), x), xs)
APP(app(app(app(f, app(s, x)), 0), z), u) → APP(minus, z)
APP(app(app(app(filter2, true), fun), x), xs) → APP(app(cons, x), app(app(filter, fun), xs))
APP(perfectp, app(s, x)) → APP(app(f, x), app(s, 0))
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(minus, y)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(app(f, x), u), z)
APP(app(map, fun), app(app(cons, x), xs)) → APP(fun, x)
APP(app(filter, fun), app(app(cons, x), xs)) → APP(filter2, app(fun, x))
APP(app(app(app(f, app(s, x)), 0), z), u) → APP(app(f, x), u)
APP(app(app(app(filter2, true), fun), x), xs) → APP(app(filter, fun), xs)
APP(app(filter, fun), app(app(cons, x), xs)) → APP(app(filter2, app(fun, x)), fun)
APP(perfectp, app(s, x)) → APP(app(app(app(f, x), app(s, 0)), app(s, x)), app(s, x))
APP(app(app(app(filter2, false), fun), x), xs) → APP(filter, fun)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(app(f, app(s, x)), app(app(minus, y), x)), z)
APP(app(map, fun), app(app(cons, x), xs)) → APP(app(map, fun), xs)
APP(app(filter, fun), app(app(cons, x), xs)) → APP(fun, x)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(app(app(f, x), u), z), u)
APP(perfectp, app(s, x)) → APP(s, 0)
APP(app(app(app(f, app(s, x)), 0), z), u) → APP(f, x)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(le, x), y)
APP(app(app(app(f, app(s, x)), 0), z), u) → APP(app(app(f, x), u), app(app(minus, z), app(s, x)))
APP(app(app(app(filter2, true), fun), x), xs) → APP(filter, fun)
APP(app(app(app(f, app(s, x)), 0), z), u) → APP(app(minus, z), app(s, x))
APP(app(app(app(f, app(s, x)), 0), z), u) → APP(app(app(app(f, x), u), app(app(minus, z), app(s, x))), u)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(f, x)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(app(if, app(app(le, x), y)), app(app(app(app(f, app(s, x)), app(app(minus, y), x)), z), u)), app(app(app(app(f, x), u), z), u))
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(if, app(app(le, x), y)), app(app(app(app(f, app(s, x)), app(app(minus, y), x)), z), u))
APP(app(app(app(filter2, true), fun), x), xs) → APP(cons, x)
APP(app(app(app(filter2, false), fun), x), xs) → APP(app(filter, fun), xs)
APP(app(map, fun), app(app(cons, x), xs)) → APP(cons, app(fun, x))

The TRS R consists of the following rules:

app(perfectp, 0) → false
app(perfectp, app(s, x)) → app(app(app(app(f, x), app(s, 0)), app(s, x)), app(s, x))
app(app(app(app(f, 0), y), 0), u) → true
app(app(app(app(f, 0), y), app(s, z)), u) → false
app(app(app(app(f, app(s, x)), 0), z), u) → app(app(app(app(f, x), u), app(app(minus, z), app(s, x))), u)
app(app(app(app(f, app(s, x)), app(s, y)), z), u) → app(app(app(if, app(app(le, x), y)), app(app(app(app(f, app(s, x)), app(app(minus, y), x)), z), u)), app(app(app(app(f, x), u), z), u))
app(app(map, fun), nil) → nil
app(app(map, fun), app(app(cons, x), xs)) → app(app(cons, app(fun, x)), app(app(map, fun), xs))
app(app(filter, fun), nil) → nil
app(app(filter, fun), app(app(cons, x), xs)) → app(app(app(app(filter2, app(fun, x)), fun), x), xs)
app(app(app(app(filter2, true), fun), x), xs) → app(app(cons, x), app(app(filter, fun), xs))
app(app(app(app(filter2, false), fun), x), xs) → app(app(filter, fun), xs)

The set Q consists of the following terms:

app(perfectp, 0)
app(perfectp, app(s, x0))
app(app(app(app(f, 0), x0), 0), x1)
app(app(app(app(f, 0), x0), app(s, x1)), x2)
app(app(app(app(f, app(s, x0)), 0), x1), x2)
app(app(app(app(f, app(s, x0)), app(s, x1)), x2), x3)
app(app(map, x0), nil)
app(app(map, x0), app(app(cons, x1), x2))
app(app(filter, x0), nil)
app(app(filter, x0), app(app(cons, x1), x2))
app(app(app(app(filter2, true), x0), x1), x2)
app(app(app(app(filter2, false), x0), x1), x2)

We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [13,14,18] contains 2 SCCs with 32 less nodes.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ EdgeDeletionProof
            ↳ QDP
              ↳ DependencyGraphProof
                ↳ AND
QDP
                    ↳ QDPOrderProof
                  ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

APP(app(app(app(f, app(s, x)), 0), z), u) → APP(app(app(app(f, x), u), app(app(minus, z), app(s, x))), u)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(app(app(f, x), u), z), u)

The TRS R consists of the following rules:

app(perfectp, 0) → false
app(perfectp, app(s, x)) → app(app(app(app(f, x), app(s, 0)), app(s, x)), app(s, x))
app(app(app(app(f, 0), y), 0), u) → true
app(app(app(app(f, 0), y), app(s, z)), u) → false
app(app(app(app(f, app(s, x)), 0), z), u) → app(app(app(app(f, x), u), app(app(minus, z), app(s, x))), u)
app(app(app(app(f, app(s, x)), app(s, y)), z), u) → app(app(app(if, app(app(le, x), y)), app(app(app(app(f, app(s, x)), app(app(minus, y), x)), z), u)), app(app(app(app(f, x), u), z), u))
app(app(map, fun), nil) → nil
app(app(map, fun), app(app(cons, x), xs)) → app(app(cons, app(fun, x)), app(app(map, fun), xs))
app(app(filter, fun), nil) → nil
app(app(filter, fun), app(app(cons, x), xs)) → app(app(app(app(filter2, app(fun, x)), fun), x), xs)
app(app(app(app(filter2, true), fun), x), xs) → app(app(cons, x), app(app(filter, fun), xs))
app(app(app(app(filter2, false), fun), x), xs) → app(app(filter, fun), xs)

The set Q consists of the following terms:

app(perfectp, 0)
app(perfectp, app(s, x0))
app(app(app(app(f, 0), x0), 0), x1)
app(app(app(app(f, 0), x0), app(s, x1)), x2)
app(app(app(app(f, app(s, x0)), 0), x1), x2)
app(app(app(app(f, app(s, x0)), app(s, x1)), x2), x3)
app(app(map, x0), nil)
app(app(map, x0), app(app(cons, x1), x2))
app(app(filter, x0), nil)
app(app(filter, x0), app(app(cons, x1), x2))
app(app(app(app(filter2, true), x0), x1), x2)
app(app(app(app(filter2, false), x0), x1), x2)

We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [13]. Here, we combined the reduction pair processor with the A-transformation [14] which results in the following intermediate Q-DP Problem.
Q DP problem:
The TRS P consists of the following rules:

F(s(x), s(y), z, u) → F(x, u, z, u)
F(s(x), 0, z, u) → F(x, u, minus(z, s(x)), u)

R is empty.
The set Q consists of the following terms:

PERFECTP(0)
PERFECTP(s(x0))
f(0, x0, 0, x1)
f(0, x0, s(x1), x2)
f(s(x0), 0, x1, x2)
f(s(x0), s(x1), x2, x3)
map(x0, nil)
map(x0, cons(x1, x2))
filter(x0, nil)
filter(x0, cons(x1, x2))
filter2(true, x0, x1, x2)
filter2(false, x0, x1, x2)

We have to consider all minimal (P,Q,R)-chains.


The following pairs can be oriented strictly and are deleted.


APP(app(app(app(f, app(s, x)), 0), z), u) → APP(app(app(app(f, x), u), app(app(minus, z), app(s, x))), u)
APP(app(app(app(f, app(s, x)), app(s, y)), z), u) → APP(app(app(app(f, x), u), z), u)
The remaining pairs can at least be oriented weakly.
none
Used ordering: Combined order from the following AFS and order.
F(x1, x2, x3, x4)  =  F(x1, x3, x4)
s(x1)  =  s(x1)
0  =  0
minus(x1, x2)  =  minus

Lexicographic Path Order [19].
Precedence:
F3 > minus > s1
0 > s1

The following usable rules [14] were oriented: none



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ EdgeDeletionProof
            ↳ QDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ QDP
                    ↳ QDPOrderProof
QDP
                        ↳ PisEmptyProof
                  ↳ QDP

Q DP problem:
P is empty.
The TRS R consists of the following rules:

app(perfectp, 0) → false
app(perfectp, app(s, x)) → app(app(app(app(f, x), app(s, 0)), app(s, x)), app(s, x))
app(app(app(app(f, 0), y), 0), u) → true
app(app(app(app(f, 0), y), app(s, z)), u) → false
app(app(app(app(f, app(s, x)), 0), z), u) → app(app(app(app(f, x), u), app(app(minus, z), app(s, x))), u)
app(app(app(app(f, app(s, x)), app(s, y)), z), u) → app(app(app(if, app(app(le, x), y)), app(app(app(app(f, app(s, x)), app(app(minus, y), x)), z), u)), app(app(app(app(f, x), u), z), u))
app(app(map, fun), nil) → nil
app(app(map, fun), app(app(cons, x), xs)) → app(app(cons, app(fun, x)), app(app(map, fun), xs))
app(app(filter, fun), nil) → nil
app(app(filter, fun), app(app(cons, x), xs)) → app(app(app(app(filter2, app(fun, x)), fun), x), xs)
app(app(app(app(filter2, true), fun), x), xs) → app(app(cons, x), app(app(filter, fun), xs))
app(app(app(app(filter2, false), fun), x), xs) → app(app(filter, fun), xs)

The set Q consists of the following terms:

app(perfectp, 0)
app(perfectp, app(s, x0))
app(app(app(app(f, 0), x0), 0), x1)
app(app(app(app(f, 0), x0), app(s, x1)), x2)
app(app(app(app(f, app(s, x0)), 0), x1), x2)
app(app(app(app(f, app(s, x0)), app(s, x1)), x2), x3)
app(app(map, x0), nil)
app(app(map, x0), app(app(cons, x1), x2))
app(app(filter, x0), nil)
app(app(filter, x0), app(app(cons, x1), x2))
app(app(app(app(filter2, true), x0), x1), x2)
app(app(app(app(filter2, false), x0), x1), x2)

We have to consider all minimal (P,Q,R)-chains.
The TRS P is empty. Hence, there is no (P,Q,R) chain.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ EdgeDeletionProof
            ↳ QDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ QDP
QDP
                    ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

APP(app(app(app(filter2, true), fun), x), xs) → APP(app(filter, fun), xs)
APP(app(map, fun), app(app(cons, x), xs)) → APP(fun, x)
APP(app(filter, fun), app(app(cons, x), xs)) → APP(app(app(app(filter2, app(fun, x)), fun), x), xs)
APP(app(app(app(filter2, false), fun), x), xs) → APP(app(filter, fun), xs)
APP(app(filter, fun), app(app(cons, x), xs)) → APP(fun, x)
APP(app(map, fun), app(app(cons, x), xs)) → APP(app(map, fun), xs)

The TRS R consists of the following rules:

app(perfectp, 0) → false
app(perfectp, app(s, x)) → app(app(app(app(f, x), app(s, 0)), app(s, x)), app(s, x))
app(app(app(app(f, 0), y), 0), u) → true
app(app(app(app(f, 0), y), app(s, z)), u) → false
app(app(app(app(f, app(s, x)), 0), z), u) → app(app(app(app(f, x), u), app(app(minus, z), app(s, x))), u)
app(app(app(app(f, app(s, x)), app(s, y)), z), u) → app(app(app(if, app(app(le, x), y)), app(app(app(app(f, app(s, x)), app(app(minus, y), x)), z), u)), app(app(app(app(f, x), u), z), u))
app(app(map, fun), nil) → nil
app(app(map, fun), app(app(cons, x), xs)) → app(app(cons, app(fun, x)), app(app(map, fun), xs))
app(app(filter, fun), nil) → nil
app(app(filter, fun), app(app(cons, x), xs)) → app(app(app(app(filter2, app(fun, x)), fun), x), xs)
app(app(app(app(filter2, true), fun), x), xs) → app(app(cons, x), app(app(filter, fun), xs))
app(app(app(app(filter2, false), fun), x), xs) → app(app(filter, fun), xs)

The set Q consists of the following terms:

app(perfectp, 0)
app(perfectp, app(s, x0))
app(app(app(app(f, 0), x0), 0), x1)
app(app(app(app(f, 0), x0), app(s, x1)), x2)
app(app(app(app(f, app(s, x0)), 0), x1), x2)
app(app(app(app(f, app(s, x0)), app(s, x1)), x2), x3)
app(app(map, x0), nil)
app(app(map, x0), app(app(cons, x1), x2))
app(app(filter, x0), nil)
app(app(filter, x0), app(app(cons, x1), x2))
app(app(app(app(filter2, true), x0), x1), x2)
app(app(app(app(filter2, false), x0), x1), x2)

We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [13].


The following pairs can be oriented strictly and are deleted.


APP(app(map, fun), app(app(cons, x), xs)) → APP(fun, x)
APP(app(filter, fun), app(app(cons, x), xs)) → APP(app(app(app(filter2, app(fun, x)), fun), x), xs)
APP(app(filter, fun), app(app(cons, x), xs)) → APP(fun, x)
APP(app(map, fun), app(app(cons, x), xs)) → APP(app(map, fun), xs)
The remaining pairs can at least be oriented weakly.

APP(app(app(app(filter2, true), fun), x), xs) → APP(app(filter, fun), xs)
APP(app(app(app(filter2, false), fun), x), xs) → APP(app(filter, fun), xs)
Used ordering: Combined order from the following AFS and order.
APP(x1, x2)  =  APP(x2)
app(x1, x2)  =  app(x1, x2)
filter2  =  filter2
true  =  true
filter  =  filter
map  =  map
cons  =  cons
false  =  false
perfectp  =  perfectp
0  =  0
nil  =  nil
f  =  f
s  =  s
minus  =  minus
if  =  if
le  =  le

Lexicographic Path Order [19].
Precedence:
app2 > filter > APP1 > map > filter2
app2 > cons > map > filter2
app2 > 0 > true > filter2
app2 > 0 > s > false > filter2
app2 > 0 > s > if > filter2
app2 > le > filter2
perfectp > 0 > true > filter2
perfectp > 0 > s > false > filter2
perfectp > 0 > s > if > filter2
nil > filter2
f > true > filter2
f > s > false > filter2
f > s > if > filter2
f > le > filter2
minus > filter2

The following usable rules [14] were oriented: none



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ EdgeDeletionProof
            ↳ QDP
              ↳ DependencyGraphProof
                ↳ AND
                  ↳ QDP
                  ↳ QDP
                    ↳ QDPOrderProof
QDP
                        ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

APP(app(app(app(filter2, true), fun), x), xs) → APP(app(filter, fun), xs)
APP(app(app(app(filter2, false), fun), x), xs) → APP(app(filter, fun), xs)

The TRS R consists of the following rules:

app(perfectp, 0) → false
app(perfectp, app(s, x)) → app(app(app(app(f, x), app(s, 0)), app(s, x)), app(s, x))
app(app(app(app(f, 0), y), 0), u) → true
app(app(app(app(f, 0), y), app(s, z)), u) → false
app(app(app(app(f, app(s, x)), 0), z), u) → app(app(app(app(f, x), u), app(app(minus, z), app(s, x))), u)
app(app(app(app(f, app(s, x)), app(s, y)), z), u) → app(app(app(if, app(app(le, x), y)), app(app(app(app(f, app(s, x)), app(app(minus, y), x)), z), u)), app(app(app(app(f, x), u), z), u))
app(app(map, fun), nil) → nil
app(app(map, fun), app(app(cons, x), xs)) → app(app(cons, app(fun, x)), app(app(map, fun), xs))
app(app(filter, fun), nil) → nil
app(app(filter, fun), app(app(cons, x), xs)) → app(app(app(app(filter2, app(fun, x)), fun), x), xs)
app(app(app(app(filter2, true), fun), x), xs) → app(app(cons, x), app(app(filter, fun), xs))
app(app(app(app(filter2, false), fun), x), xs) → app(app(filter, fun), xs)

The set Q consists of the following terms:

app(perfectp, 0)
app(perfectp, app(s, x0))
app(app(app(app(f, 0), x0), 0), x1)
app(app(app(app(f, 0), x0), app(s, x1)), x2)
app(app(app(app(f, app(s, x0)), 0), x1), x2)
app(app(app(app(f, app(s, x0)), app(s, x1)), x2), x3)
app(app(map, x0), nil)
app(app(map, x0), app(app(cons, x1), x2))
app(app(filter, x0), nil)
app(app(filter, x0), app(app(cons, x1), x2))
app(app(app(app(filter2, true), x0), x1), x2)
app(app(app(app(filter2, false), x0), x1), x2)

We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [13,14,18] contains 0 SCCs with 2 less nodes.